#include <iostream>
#include <gtest/gtest.h>

/*
    断言宏的使用：

        ASSERT_     断言错误直接退出
        EXPECT_     断言错误继续运行

    断言宏必须放在，TEST宏函数中
*/

int age = 20;

TEST(test, test_great_than)
{
    ASSERT_GT(age, 18);
    std::cout << "age is bigger" << std::endl;
}
TEST(test, test_less_than)
{
    EXPECT_LT(age, 18);
    std::cout << "age is bigger" << std::endl;
}
TEST(test, test_great_than_error)
{
    ASSERT_GT(age, 21);
    std::cout << "age is smaller" << std::endl;
}

int main(int argc, char *argv[])
{
    testing::InitGoogleTest(&argc, argv);
    RUN_ALL_TESTS();
}